package com.chenfan.mcn.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenfan.mcn.dao.LiveStarSettlementMapper;
import com.chenfan.common.extension.mybatisplus.enhanced.EnhancedService;
import com.chenfan.mcn.model.LiveStarSettlement;
import com.chenfan.mcn.model.dto.*;
import com.chenfan.mcn.model.rpc.ChargeClearCallback;
import com.chenfan.mcn.model.vo.*;

import java.util.List;

/**
 * <p>
 * 直播红人结算单 服务类
 * </p>
 *
 * @author wulg
 * @since 2023-03-21
 */
public interface LiveStarSettlementService extends EnhancedService<LiveStarSettlementMapper, LiveStarSettlement> {

    /**
     * 分页查询
     * @param searchDTO
     * @return
     */
    Page<LiveStarSettlementListVO> getPage(LiveStarSettlementSearchDTO searchDTO);

    /**
     * 导出excel
     * @param searchDTO
     * @return
     */
    List<LiveStarSettlementExportVO> exportExcel(LiveStarSettlementSearchDTO searchDTO);

    /**
     * 导出明细
     * @param queryDTO
     * @return
     */
    List<LiveStarSettlementCommodityVO> exportDetail(LiveStarSettlementDetailQueryDTO queryDTO);

    /**
     * 详情
     * @param id
     * @param includeDetail
     * @return
     */
    LiveStarSettlementDetailVO detail(Long id, Boolean includeDetail);

    /**
     * 保存
     * @param saveDTO
     * @return
     */
    Long save(LiveStarSettlementSaveDTO saveDTO);

    /**
     * 变更状态
     * @param id
     * @param approvalStatus
     * @param approvalRemark
     * @return
     */
    Boolean changeStatus(Long id, Integer approvalStatus, String approvalRemark);

    /**
     * 详情-分页查询
     * @param queryDTO
     * @return
     */
    Page<LiveStarSettlementCommodityVO> getDetailPage(LiveStarSettlementDetailQueryDTO queryDTO);

    /**
     * 根据单号获取直播红人结算单
     * @param settlementCode
     * @param verifyExist
     * @return
     */
    LiveStarSettlement getSettlementByCode(String settlementCode, boolean verifyExist);


    /**
     * 核销后回款回调
     *
     * @param dto 回款报文
     * @param settlementId
     * @return
     */
    boolean updatePayback(ChargeClearCallback dto, Long settlementId);
}
